import Vue from 'vue'
import VueRouter from 'vue-router'

// 加载全局样式
import '../styles/index.less'

Vue.use(VueRouter)

// 配置路由表
const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('@/views/layout/home')
      }, {
        path: '/menuSetting',
        name: 'menuSetting',
        component: () => import('@/views/pages/menuSetting')
      }, {
        path: '/dataCollection',
        name: 'dataCollection',
        component: () => import('@/views/pages/dataCollection')
      }, {
        path: '/resource',
        name: 'resource',
        component: () => import('@/views/pages/resource')
      }, {
        path: '/dataDict',
        name: 'dataDict',
        component: () => import('@/views/pages/dataDict')
      }
    ]
  }, {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login')
  }, {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  }
]

// 创建路由实例
const router = new VueRouter({
  routes
})
// 导出实例
export default router
